from django.contrib import admin
from isa.models import *


# Register your models here.

class UserInline(admin.StackedInline):
    model = User
    extra = 1

class TagInline(admin.StackedInline):
    model = Tags
    extra = 1


class UserAdmin(admin.ModelAdmin):
    fieldsets = [
            (
                "User",{
                    'fields' :[ 'user',]
                    }),
            (
                'User Head',{
                    'fields':['user_img']
                    }),
            ]
    list_display = ["user",]

class QuestionsAdmin(admin.ModelAdmin):
    fieldsets = [
        (
            "Question",{
                'fields':['title','content','answer']
            }),
        (
            "File upload",{
                'fields' : ['files']
            }),
        (
            'Links ',{
                'fields':['link'],
            }),

    ]

    inlines = [TagInline]
    list_display = ["title",]

admin.site.register(CUser,UserAdmin)
admin.site.register(Question,QuestionsAdmin)